<template>
	<uni-nav-bar title="安蓝环保" left-icon="left" @clickLeft="navBack" :fixed="true" statusBar></uni-nav-bar>
	<view class="package" style="padding-top: 1px;">
		<view class="space-between" v-for="item in information" :key="item.name" style="margin-top: 15rpx;">
			<view>{{item.name}}：</view>
			<view>{{item.nums}}</view>
		</view>
	</view>
	<view class="package space-between ability" style="background: transparent;padding: 0px;">
		<view v-for="item in list" :key="item" @click="navTo(item.push)">{{item.name}}</view>
	</view>
</template>
<script setup lang="ts">
	import { ref } from 'vue';
	import { navBack, navTo } from '@/utils/navigator';
	import { toPublish } from '@mqtt';
	import { getIndexData } from '@/gql/administrator';
	import { showLoading } from '@/utils/prompt';
	import { onShow } from '@dcloudio/uni-app';
	const list = [
		{ name: '调度派单', push: 'administrator/dispatch/dispatchList' },
		{ name: '发起预约', push: 'administrator/initiate/reservat' },
		{ name: '订单', push: 'administrator/orderList' },
		{ name: '大客户列表', push: 'administrator/keyaccount/keyList' },
		{ name: '加注机列表', push: 'administrator/fillIng/fillList' },
		{ name: '车友团', push: 'administrator/teamList/teamList' },
		{ name: '单据管理', push: 'administrator/document/management' },
		{ name: '车友主档', push: 'administrator/carFriend/friendList' },
		{ name: '身份管理', push: 'administrator/identity/identityList' },
		{ name: '加注机状态', push: 'machine/fillingList' },
		{ name: '其他端入口', push: 'administrator/statusIdentity/identityList' },
		{ name: '合作伙伴账号', push: 'administrator/accountNumber/accountList' },
		{ name: '消息推送', push: 'administrator/message/messageList' },
		{ name: '车队管理', push: 'administrator/fleet/fleetList' },
		{ name: '安蓝加注站', push: 'administrator/rehydrator/rehydratorList' },
		{ name: '发放奖励', push: 'administrator/reward/rewardList' },
		// { name: '积分商城', push: 'administrator/integral/integralList' },
		{ name: '合伙人', push: 'administrator/partner/partnerList' },
		{ name: '地推人员', push: 'administrator/sale/saleList' },
		{ name: '考勤', push: 'administrator/sale/attendance' },
		{ name: '报销', push: 'administrator/sale/expense' },
		{ name: '福利商家', push: 'administrator/business/businessList' },
		{ name: '福利品仓库', push: 'administrator/storehouse/storeList' },
		{ name: '福利品商城', push: 'administrator/welfare/welfareList' },
		{ name: '盘库', push: 'administrator/inventory/inventoryList' },
		{ name: '服务站', push: 'administrator/service/serviceList' },
		{ name: '历史班次', push: 'administrator/sale/historyWorkAll' },
	]
	const information = ref()
	onShow(() => {
		init()
	})
	function init() {
		showLoading()
		const payload = {
			query: getIndexData,
		};
		toPublish(
			'ql/control/getIndexData',
			payload,
			(obj : any) => {
				uni.hideLoading();
				const { getIndexData } = obj.data;
				information.value = getIndexData
			}
		);
	}
</script>

<style scoped lang="less">
	.ability {
		flex-wrap: wrap;

		view {
			width: 48.5%;
			height: 102rpx;
			background: #FFFFFF;
			border: 1px solid #EEF3F7;
			border-radius: 6px;
			text-align: center;
			line-height: 102rpx;
			margin-bottom: 15rpx;
		}
	}

	.top {
		margin-top: 10rpx;
	}
</style>